package com.gopay.common.domain.eis.fund.rtfund;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/*
 * Copyright (c) 2016. www.gopay.com.cn Inc.All rights reserved.
 * 文件名称 : RtCommunicateMessage
 * 创建日期 : 17/3/27 13:54
 * Author  : baiyunpeng
 */
public class RtCommunicateMessage implements Serializable {

    private static final long serialVersionUID = -8059803361929218050L;

    public boolean isCheckResp() {
        return checkResp;
    }

    public void setCheckResp(boolean checkResp) {
        this.checkResp = checkResp;
    }

    public String getRespCode() {
        return respCode;
    }

    public void setRespCode(String respCode) {
        this.respCode = respCode;
    }

    public String getRespMessage() {
        return respMessage;
    }

    public void setRespMessage(String respMessage) {
        this.respMessage = respMessage;
    }

    /**
     * 获取返回数据
     **/
    public List<List<Map<String, Object>>> getResultLists() {
        return resultLists;
    }

    public void setResultLists(List<List<Map<String, Object>>> resultLists) {
        this.resultLists = resultLists;
    }

    /**
     * 获取任意结果集
     **/
    public List<Map<String, Object>> getResultList(int index) {
        return this.getResultLists() != null && this.getResultLists().size() > index ? (List) this.getResultLists().get(index) : null;
    }

    /**
     * 获取第一结果集
     **/
    public List<Map<String, Object>> getFirstResultList() {
        return this.getResultList(0);
    }

    /**
     * 获取任意结果集第一条记录
     **/
    public Map<String, Object> getFirstRow() {
        List firstDataset = this.getFirstResultList();
        return firstDataset != null && firstDataset.size() > 0 ? (Map) firstDataset.get(0) : null;
    }

    /**
     * 获取第一结果集第一条记录
     **/
    public Map<String, Object> getFirstRow(int index) {
        List dataset = this.getResultList(index);
        return dataset != null && dataset.size() > 0 ? (Map) dataset.get(0) : null;
    }

    /**
     * 调用是否成功
     **/
    private boolean checkResp;
    /**
     * 获取返回码
     **/
    private String respCode;
    /**
     * 获取返回信息
     **/
    private String respMessage;
    /**
     * 结果集
     **/
    private List<List<Map<String, Object>>> resultLists;


}
